

<?php 



$this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'entry-grid',
	'dataProvider'=>$model->search(),
	'filter'=>$model,
	'columns'=>array(
	//	'id',
	//	'code',
		//'client_id',
		'date',
		array(	
        'name'  => 'code',
        'value' => 'CHtml::link($data->code, Yii::app()
 ->createUrl("entry/view",array("id"=>$data->primaryKey)))',
        'type'  => 'raw',
    ),
	
	
	array(
		'header' => 'Container/s',
		// 'filter'=>CHtml::listData(Container::model()->findAll(array('order'=>'code ASC')), 'id', 'code'),
		'filter' => CHtml::activeTextField(Container::model(), 'code'),
                        'value'=>function($data) { 
						
						
                            return implode(', ', array_keys($data->container(array('index' => 'code'))));
                         } 
                ), 
	'item',
				
				array(
		'header' => 'Employee Tasks',
		
		//'filter' => CHtml::activeTextField(EmployeeTask::model(), 'employee_id'),
                        'value'=>function($data) { 

                            return implode(', ', array_keys($data->employeeTasks(array('index' => 'employee_id'))));
                         } 
                ), 
				
				array('name'=>'status_id', 'header'=>'Status', 
			'filter'=>CHtml::dropDownList('Entry[status_id]', '',  
                array(
				'' => '',
                   '1'=>'Ready for Lodging',
                    '2'=>'Lodged, Waiting for Temporary Assessment',
                    '3'=>'Ready for Filing',
					'4'=>'Filed, Waiting for Filing Assessment',
					'5'=>'Ready for Payment',
					'6'=>'Waiting for Gate Pass',
					'7'=>'Ready for Release',
					'8'=>'Released',
					'9'=>'Documentation'
                )
            ),
			
		  'value'=>'$data->status->description'
		
		),
		
		
		array('name'=>'client_id', 'header'=>'Client', 
		'type'=>'raw',
		  'value'=>'CHtml::link($data->client->name, array("client/view", "id"=>$data->client_id))',

			//'filter' => CHtml::listData(Client::model()->findAll(), 'id', 'name'),

		
		),
		array('name'=>'port_id', 'header'=>'Port', 'type'=>'raw',
		  'value'=>'CHtml::link($data->port->name, array("port/view", "id"=>$data->port_id))',
		  
		  //'filter' => CHtml::listData(Port::model()->findAll(), 'id', 'name'),
		  
		  
		),
		array('name'=>'shipping_line_id', 'header'=>'Shipping Line', 
		'type'=>'raw',
		  'value'=>'CHtml::link($data->shippingLine->name, array("shippingLine/view", "id"=>$data->shipping_line_id))',
		  
		  //'filter' => CHtml::listData(shippingLine::model()->findAll(), 'id', 'name'),
		),
	
		
		'customs_entry_no',
		
		//'date',
		'lodge_date',
		'ETA',
		array(
            'name'=>'selectivity',
            'filter'=>CHtml::dropDownList('Entry[selectivity]', '',  
                array(
					'*'=>'',
                   'Pending'=>'Pending',
                    'Red'=>'Red',
                    'Yellow'=>'Yellow',
					'Green'=>'Green'
					
                )
            ),
        ),
		//'selectivity',
		//'section',
		//'arrastre',
		//'wharfage',
		//'container_deposit',
		//'freight',
		//'bill_of_lading_no',
		'final_assessment',
		
		
		/*
		array(
			'class'=>'CButtonColumn',
		),
		*/
	),
));?>

